import type { PageParam, PageResult } from '@vben/request';
import type { Dayjs } from 'dayjs';

import { requestClient } from '#/api/request';

export namespace TechniciansApi {
    /** 技师管理信息 */
  export interface Technicians {
            id: number; // 主键ID
            technicianCode?: string; // 技师编号
            name?: string; // 技师姓名
            gender?: string; // 性别
            department?: string; // 所属部门
            employeeCard?: string; // 员工卡号
            productType?: string; // 产品类型
            status?: string; // 技师状态
            currentServiceTime: localtime; // 当前服务时长
            currentServiceName: string; // 当前服务项目
            currentRoomNumber: string; // 当前房间号
            currentCount: number; // 当前服务次数
            totalCount: number; // 总服务次数
      }
}

/** 查询技师管理分页 */
export function getTechniciansPage(params: PageParam) {
  return requestClient.get<PageResult<TechniciansApi.Technicians>>('/spa/technicians/page', { params });
}

/** 查询技师管理详情 */
export function getTechnicians(id: number) {
  return requestClient.get<TechniciansApi.Technicians>(`/spa/technicians/get?id=${id}`);
}

/** 新增技师管理 */
export function createTechnicians(data: TechniciansApi.Technicians) {
  return requestClient.post('/spa/technicians/create', data);
}

/** 修改技师管理 */
export function updateTechnicians(data: TechniciansApi.Technicians) {
  return requestClient.put('/spa/technicians/update', data);
}

/** 删除技师管理 */
export function deleteTechnicians(id: number) {
  return requestClient.delete(`/spa/technicians/delete?id=${id}`);
}

/** 批量删除技师管理 */
export function deleteTechniciansList(ids: number[]) {
  return requestClient.delete(`/spa/technicians/delete-list?ids=${ids.join(',')}`)
}

/** 导出技师管理 */
export function exportTechnicians(params: any) {
  return requestClient.download('/spa/technicians/export-excel', params);
}

